package com.practice.springboot_01_zwj.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class MainTask {
    private Integer mainId; //主任务Id
    private String mainName;  //任务名
    private String mainDescription; //任务详细描述
    private String distributor; //派发人
    private String executor; //执行人
    private String belonging; //执行人归属组织
    private String phone;  //执行人电话
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planBeginTime;  //计划开始时间
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planEndTime;  //计划结束时间
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date actualFinishTime;  //实际完成时间
    private Double taskProgress = 0.0; //任务进度
    private Double timeProgress = 0.0; //时间进度

    private String taskImplementation = "落后"; //落实情况（超前/正常/落后）
    private Integer taskState;  //主任务状态
    private Integer userId;  //用户Id，关联accountInfo
    @JsonManagedReference
    private List<SubTask> subTasks;
    private Integer subtaskCount; // 我的子目标数量（当前用户作为执行人的子任务数量）
    private Integer incompleteSubtaskCount; // 未完成子目标数量（当前用户作为执行人且未完成的子任务）
    private String distributorAcName; //派发人中文名称
    private String executorAcName;  //执行人中文名称
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date actualFinishTimeStart; //完成开始时间
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date actualFinishTimeEnd;  //完成结束时间

    private String taskType; //任务类型

    // 我的关键结果数量（当前用户作为执行人的批量子任务数量）-- 新增字段
    private Integer keyResultCount;

    private String specializedName; //专项名称
    private String deptName; //科室名称

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getSpecializedName() {
        return specializedName;
    }

    public void setSpecializedName(String specializedName) {
        this.specializedName = specializedName;
    }

    public Integer getKeyResultCount() {
        return keyResultCount;
    }

    public void setKeyResultCount(Integer keyResultCount) {
        this.keyResultCount = keyResultCount;
    }

    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public Date getActualFinishTimeStart() {
        return actualFinishTimeStart;
    }

    public void setActualFinishTimeStart(Date actualFinishTimeStart) {
        this.actualFinishTimeStart = actualFinishTimeStart;
    }

    public Date getActualFinishTimeEnd() {
        return actualFinishTimeEnd;
    }

    public void setActualFinishTimeEnd(Date actualFinishTimeEnd) {
        this.actualFinishTimeEnd = actualFinishTimeEnd;
    }

    public String getDistributorAcName() {
        return distributorAcName;
    }

    public void setDistributorAcName(String distributorAcName) {
        this.distributorAcName = distributorAcName;
    }

    public String getExecutorAcName() {
        return executorAcName;
    }

    public void setExecutorAcName(String executorAcName) {
        this.executorAcName = executorAcName;
    }

    public Integer getIncompleteSubtaskCount() {
        return incompleteSubtaskCount;
    }

    public void setIncompleteSubtaskCount(Integer incompleteSubtaskCount) {
        this.incompleteSubtaskCount = incompleteSubtaskCount;
    }

    public Integer getSubtaskCount() {
        return subtaskCount;
    }

    public void setSubtaskCount(Integer subtaskCount) {
        this.subtaskCount = subtaskCount;
    }

    public List<SubTask> getSubTasks() {
        return subTasks;
    }

    public void setSubTasks(List<SubTask> subTasks) {
        this.subTasks = subTasks;
    }

    public Integer getMainId() {
        return mainId;
    }

    public void setMainId(Integer mainId) {
        this.mainId = mainId;
    }

    public String getMainName() {
        return mainName;
    }

    public void setMainName(String mainName) {
        this.mainName = mainName;
    }

    public String getMainDescription() {
        return mainDescription;
    }

    public void setMainDescription(String mainDescription) {
        this.mainDescription = mainDescription;
    }

    public String getDistributor() {
        return distributor;
    }

    public void setDistributor(String distributor) {
        this.distributor = distributor;
    }

    public String getExecutor() {
        return executor;
    }

    public void setExecutor(String executor) {
        this.executor = executor;
    }

    public String getBelonging() {
        return belonging;
    }

    public void setBelonging(String belonging) {
        this.belonging = belonging;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getPlanBeginTime() {
        return planBeginTime;
    }

    public void setPlanBeginTime(Date planBeginTime) {
        this.planBeginTime = planBeginTime;
    }

    public Date getPlanEndTime() {
        return planEndTime;
    }

    public void setPlanEndTime(Date planEndTime) {
        this.planEndTime = planEndTime;
    }

    public Date getActualFinishTime() {
        return actualFinishTime;
    }

    public void setActualFinishTime(Date actualFinishTime) {
        this.actualFinishTime = actualFinishTime;
    }

    public Double getTaskProgress() {
        return taskProgress != null ? taskProgress : 0.0;
    }

    public void setTaskProgress(Double taskProgress) {
        this.taskProgress = taskProgress;
    }

    public Double getTimeProgress() {
        return timeProgress;
    }

    public void setTimeProgress(Double timeProgress) {
        this.timeProgress = timeProgress;
    }

    public String getTaskImplementation() {
        return taskImplementation != null ? taskImplementation : "落后";
    }

    public void setTaskImplementation(String taskImplementation) {
        this.taskImplementation = taskImplementation;
    }

    public Integer getTaskState() {
        return taskState;
    }

    public void setTaskState(Integer taskState) {
        this.taskState = taskState;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
}
